<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div>
	<c:if test="${not empty message}">
		<div style="clear:both;color:red;"><c:out value="${message}"/></div>
	</c:if>
	<form id="f_wishtype" action="<c:url value='/admin/wish/type/save.do'/>" method="post" enctype="multipart/form-data">
		<input type="hidden" name="wishType.typeid" value="${wishType.typeid}">
		<table id="t_wishType_detail">
			<tr>
				<th width="75px">类型名称</th>
				<td>
					<input type="text" name="wishType.name" value="${wishType.name}"/>
				</td>
			</tr>
			<tr>
				<th width="75px">小图片大小(px)最好是正方形，如果是长方形，写入长</th>
				<td>
					<input type="text" name="wishType.imgSize" value="${wishType.imgSize}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">最少字符</th>
				<td>
					<input type="text" name="wishType.charsMin" value="${wishType.charsMin}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">最多字符</th>
				<td>
					<input type="text" name="wishType.charsMax" value="${wishType.charsMax}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">每页最多显示数量<font color="red">*</font></th>
				<td>
					<input type="text" name="wishType.threshold" value="${wishType.threshold}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">此类型一共多少WISH</th>
				<td>
					<input type="text" name="wishType.capacity" value="${wishType.capacity}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">当前激活数</th>
				<td>
					<input type="text" name="wishType.activityAmount" value="${wishType.activityAmount}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">历史总算</th>
				<td>
					<input type="text" name="wishType.totalAmount" value="${wishType.totalAmount}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">是否可用</th>
				<td>
					<input type="checkbox" id="f_wishtype_enabled" name="wishType.enabled" value="1"/>
					<script type="text/javascript">
						var wishtypeEnabled = "<c:out value='${wishType.enabled}' />";
						var wishtypeEnabledValue = parseInt(wishtypeEnabled);
						if(wishtypeEnabledValue == 1){
							$("#f_wishtype_enabled").attr("checked",true);
					  	}
					</script>
				</td>
			</tr>
			<tr>
				<th width="75px">小图片坐标数量(必须大于等于 每页最多显示数量 )</th>
				<td>
					<c:out value='${wishType.positionAmount}'/>
				</td>
			</tr>
			<tr>
				<th width="75px">小图片位置;格式：x1,y1;x2,y2;x3,y3(x,y最多为4位数字)</th>
				<td>
					<textarea id="wishType_position" name="wishType.position" rows="150" cols="80" style="width:600px;height:300px"><c:out value='${wishType.position}'/></textarea>
				</td>
			</tr>
			<tr>
				<th width="75px">描述</th>
				<td>
					<textarea id="wishType_description" name="wishType.description" rows="150" cols="80" style="width:600px;height:300px"><c:out value='${wishType.description}'/></textarea>
				</td>
			</tr>
			<tr>
			<th width="75px">背景图片</th>
				<td>
					<input type="file" name="bg" />
				</td>
			</tr>
			<tr>
			<th width="75px">背景图片</th>
				<td>
					<input type="text" name="wishType.htmlBgImg" value="${wishType.htmlBgImg}" />
					<br/>
					<img alt="背景图片" src="${ctx}/${wishType.htmlBgImg}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">未激活图片</th>
				<td>
					<input type="file" name="common" />
				</td>
			</tr>
			<tr>
			<th width="75px">未激活图片</th>
				<td>
					<input type="text" name="wishType.htmlCommonImg" value="${wishType.htmlCommonImg}" />
					<br/>
					<img alt="未激活图片" src="${ctx}/${wishType.htmlCommonImg}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">激活图片</th>
				<td>
					<input type="file" name="active" />
				</td>
			</tr>
			<tr>
			<th width="75px">激活图片</th>
				<td>
					<input type="text" name="wishType.htmlActiveImg" value="${wishType.htmlActiveImg}" />
					<br/>
					<img alt="激活图片" src="${ctx}/${wishType.htmlActiveImg}"/>
				</td>
			</tr>
			<tr>
				<td><input type="submit" name="保存" value="保存"/></td>
			</tr>
		</table>
	</form>
</div>